describe('App.PublicLoginController', function() {
    var controller;

    beforeEach(function() {
        App.PublicLoginController.reopen({
            init: function() {
            }
        });

        controller = App.PublicLoginController.create({
            controllers: Ember.Object.create({
                alert: Ember.Object.create({
                    showAlert: function(msg) {
                    }
                })
            })
        });
    })

    describe('verifyInputs', function() {
        beforeEach(function(){
            controller = App.PublicLoginController.create();
        });

//        it('username with non-alphanumeric character', function() {
//            spyOn(BreezeException, 'create');
//            try {
//                controller.verifyInputs('1#', 'password', '');
//            } catch(e) {
//            }
//            expect(BreezeException.create).toHaveBeenCalledWith({errorMessage:'Please enter a valid username without any space or Special characters.'});
//        });
        it('username does not have enough length', function() {
            spyOn(BreezeException, 'create');
            try {
                controller.verifyInputs('123', 'password', '');
            } catch(e) {
            }
            expect(BreezeException.create).toHaveBeenCalledWith({errorMessage: 'Please enter a valid username and password.'});
        });
        it('password does not have enough length', function() {
            spyOn(BreezeException, 'create');
            try {
                controller.verifyInputs('username', '123', '');
            } catch(e) {
            }
            expect(BreezeException.create).toHaveBeenCalledWith({errorMessage: 'Please enter a valid username and password.'});
        });
    });

    describe('verifySpecialCharacters', function() {
        beforeEach(function(){
            controller = App.PublicLoginController.create();
        });

//        it('username with non-alphanumeric character', function() {
//            spyOn(BreezeException, 'create');
//            try {
//                controller.verifySpecialCharacters('1#', 'password', '');
//            } catch(e) {
//            }
//            expect(BreezeException.create).toHaveBeenCalledWith({errorMessage: 'Please enter a valid username without any space or Special characters.'});
//        });
    });
});